<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex serviceClassification_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center flex-sub serviceClassification_fd0_0'>
					<view class='flex flex-wrap align-center serviceClassification_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="switchTab" :data-url="`/pages/tabBar/classify/classify`">
						<text class='fu-iconfont2  serviceClassification_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center serviceClassification_fd0_0_c1'
						v-if="appSystemIdentification!='Wechat'">
						<image class='serviceClassification_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"132.png"'
							@tap.stop="getcCassificationFunc()"></image>
						<benben-input class='flex-sub serviceClassification_fd0_0_c1_c1' type="text"
							:placeholder="`请输入想要搜索的服务`" confirm-type="done" :maxlength="50"
							placeholder-style="color:rgba(153, 153, 153, 1);font-size:24rpx"
							@confirm="getcCassificationFunc()" v-model="keyword" />
					</view>
					<view class='flex flex-wrap align-center serviceClassification_fd0_0_c1001'
						v-if="appSystemIdentification=='Wechat'">
						<image class='serviceClassification_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"132.png"'
							@tap.stop="getcCassificationFunc()"></image>
						<benben-input class='flex-sub serviceClassification_fd0_0_c1_c1' type="text"
							:placeholder="`请输入想要搜索的服务`" confirm-type="done" :maxlength="50"
							placeholder-style="color:rgba(153, 153, 153, 1);font-size:24rpx"
							@confirm="getcCassificationFunc()" v-model="keyword" />
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---服务列表flex布局开始-->
			<view class="flex flex-wrap align-start justify-between benben-flex-layout serviceClassification_flex_1">
				<template v-for='(item,key0) in serviceList'>
					<view class='flex flex-direction flex-wrap align-stretch serviceClassification_fd1_0'
						@tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/index/serviceDetails/serviceDetails?id=${item.aid}&serviceName=${item.service_title}`"
						:key='key0'>
						<image class='serviceClassification_fd1_0_c0' mode="aspectFill" :src='item.picture'></image>
						<text class='serviceClassification_fd1_0_c1'>{{item.service_title}}</text>
						<button class='serviceClassification_fd1_0_c2'>{{item.server_type_name}}</button>
						<view class='flex flex-wrap align-center serviceClassification_fd1_0_c3'
							@tap.stop="handleJumpDiy" data-type="navigateTo"
							:data-url="`/pages/index/shopList/shopList?aid=${item.usermerchant_id}`"
							v-if=" item.usermerchant_id>0">
							<text class='serviceClassification_fd1_0_c3_c0'>{{item.store_name}}</text>
							<text class='serviceClassification_fd1_0_c3_c1'>进店</text>
							<text class='fu-iconfont2  serviceClassification_fd1_0_c3_c2'>&#xe7f2;</text>
						</view>
						<view class='flex flex-wrap align-center serviceClassification_fd1_0_c4'>
							<text class='serviceClassification_fd1_0_c4_c0'>￥</text>
							<text class=' serviceClassification_fd1_0_c4_c1'>
								<text>{{ item.deposit_money | frontPrice }}</text>
								<text
									class=' serviceClassification_price2_fd1_0_c4_c1'>{{ item.deposit_money | laterPrice }}</text>
							</text>
							<text class='serviceClassification_fd1_0_c4_c2'>{{item.unit_name}}</text>
						</view>
						<view class='flex flex-wrap align-center serviceClassification_fd1_0_c5'>
							<text class='serviceClassification_fd1_0_c5_c0'>￥</text>
							<text class='serviceClassification_fd1_0_c5_c0'>{{item.scribe_money}}</text>
							<text class='serviceClassification_fd1_0_c5_c2'>销量</text>
							<text class='serviceClassification_fd1_0_c5_c3'>{{item.sales_volume}}</text>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---服务列表flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"serviceList": [],
				"keyword": "",
				"aid": "",
				"cityinfo": {
					"text": "",
					"lat": "",
					"lng": ""
				},
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			/**
			 * @returns 
			 * Android       安卓
			 * IOS       苹果
			 * Web       H5 或 pc
			 * Wechat       微信小程序
			 * Alipay       支付宝小程序
			 * Baidu       百度小程序
			 * ByteBounce       抖音小程序
			 * 360       360小程序
			 * FastApp       快应用
			 */
			appSystemIdentification() {
				return this.$store.state.appSystemIdentification
			}
		},
		watch: {},
		onLoad(options) {
			let {
				keyword,
				aid
			} = options
			if (keyword !== undefined) this.keyword = keyword
			if (aid !== undefined) this.aid = aid
			this.getcCassificationFunc()
			uni.showShareMenu({
				withShareTicket: true,
				//设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
				menus: ["shareAppMessage", "shareTimeline"]
			})
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getcCassificationFunc()
		},
		onShareAppMessage() {
			return {
				title: '高整无忧-数字家政平台',
				path: `/pages/index/serviceClassification/serviceClassification?aid=${this.aid}`
			}
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取分类
			getcCassificationFunc() {
				this.cityinfo = uni.getStorageSync('cityinfo')
				this.keyword = this.keyword;
				this.minixPagingListsApi = global.apiUrls.post63f733482e656;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					aid: this.aid,
					keyword: this.keyword,
					city_name: this.cityinfo.text
				}
				this.listData = [];
				this.serviceList = this.listData;
				this.pagingListToggle();

			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.serviceClassification_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.serviceClassification_fd0_0_c1_c1 {
		font-size: 24rpx;
		font-weight: 500;
		color: #333;
	}

	.serviceClassification_fd0_0_c1_c0 {
		width: 36rpx;
		height: 36rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.serviceClassification_fd0_0_c1001 {
		background: #F9F9F9;
		height: 64rpx;
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		background-size: 100% auto !important;
		padding: 0rpx 24rpx 0rpx 24rpx;
		width: 430rpx;
	}

	.serviceClassification_fd0_0_c1 {
		background: #F9F9F9;
		height: 64rpx;
		border-radius: 34rpx 34rpx 34rpx 34rpx;
		background-size: 100% auto !important;
		padding: 0rpx 24rpx 0rpx 24rpx;
		width: 600rpx;
	}

	.serviceClassification_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.serviceClassification_fd0_0_c0 {
		margin: 0rpx 24rpx 0rpx 24rpx;
		height: 88rpx;
	}

	.serviceClassification_fd0_0 {
		height: 88rpx;
	}

	.serviceClassification_flex_1 {
		padding: 20rpx 19rpx 0rpx 19rpx;
	}

	.serviceClassification_fd1_0_c5_c3 {
		margin: 2rpx 0rpx 0rpx 0rpx;
	}

	.serviceClassification_fd1_0_c5_c2 {
		margin: 0rpx 0rpx 0rpx auto;
	}

	.serviceClassification_fd1_0_c5_c0 {
		text-decoration: line-through;
	}

	.serviceClassification_fd1_0_c5 {
		color: rgba(146, 146, 146, 1);
		font-size: 26rpx;
		margin: 10rpx 20rpx 24rpx 20rpx;
	}

	.serviceClassification_fd1_0_c4_c2 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(255, 80, 80, 1);
		line-height: 33rpx;
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.serviceClassification_price2_fd1_0_c4_c1 {
		font-size: 22rpx;
	}

	.serviceClassification_fd1_0_c4_c1 {
		font-size: 32rpx;
		font-weight: 700;
		color: rgba(255, 80, 80, 1);
		line-height: 40rpx;
	}

	.serviceClassification_fd1_0_c4_c0 {
		font-size: 20rpx;
		font-weight: 700;
		color: rgba(255, 80, 80, 1);
		line-height: 40rpx;
	}

	.serviceClassification_fd1_0_c4 {
		margin: 0rpx 20rpx 0rpx 20rpx;
	}

	.serviceClassification_fd1_0_c3_c2 {
		font-size: 16rpx;
		color: rgba(191, 191, 191, 1);
		margin: 3rpx 0rpx 0rpx 10rpx;
	}

	.serviceClassification_fd1_0_c3_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(191, 191, 191, 1);
		margin: 0rpx 0rpx 0rpx 20rpx;
	}

	.serviceClassification_fd1_0_c3_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(191, 191, 191, 1);
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		max-width: 190rpx;
	}

	.serviceClassification_fd1_0_c3 {
		margin: 0rpx 24rpx 10rpx 24rpx;
	}

	.serviceClassification_fd1_0_c2 {
		background: var(--benbenbgColor2);
		border-radius: 16rpx 0rpx 16rpx 0rpx;
		line-height: 40rpx;
		font-size: 24rpx;
		color: #fff;
		position: absolute;
		height: 40rpx;
		padding: 0rpx 10rpx 0rpx 10rpx;
	}

	.serviceClassification_fd1_0_c1 {
		font-size: 28rpx;
		font-weight: 700;
		color: #333333;
		-webkit-line-clamp: 2;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 40rpx;
		margin: 24rpx 20rpx 10rpx 20rpx;
	}

	.serviceClassification_fd1_0_c0 {
		width: 346rpx;
		height: 346rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
	}

	.serviceClassification_fd1_0 {
		background: #fff;
		width: 346rpx;
		background-size: 100% auto !important;
		border-radius: 24rpx 24rpx 16rpx 16rpx;
		margin: 0rpx 5rpx 10rpx 5rpx;
		position: relative;
	}
</style>